<form class="layui-form ajax _form" method="post" action="{if condition=" isset($data.user_id) "}{:url('home/User/go_edit','uid='.$data['user_id'])}{else /}{:url('home/User/go_add')}{/if}">
    <div class="layui-form-item">
        <label class="layui-form-label"> 所属角色</label>
        <div class="layui-input-block">
            <select name="auth_id">
                {$authlist}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" > 用户名 </label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" placeholder="用户名" required lay-verify="required"  name="user_name" value="{$data.user_name|default=''}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"> 密码 </label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" {if condition=" isset($data) !='' "}placeholder="请输入密码,不修改留空"{else /}placeholder="请输入密码" required/ {/if}   name="user_pwd" value="" >
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"> 邮箱 </label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" placeholder="请输入邮箱" required lay-verify="required" name="email" value="{$data.email|default=''}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" > 是否启用 </label>
        <div class="layui-input-block">
        {if condition="isset($data)"}
        {if condition="$data.status eq 1"}
            <input type="checkbox" name="status" title="启用" checked>{else /}
            <input type="checkbox" name="status" title="启用">{/if}
        {else / }
            <input type="checkbox" name="status"  checked title="启用">
        {/if}
        </div>
    </div>
    <div class="layui-form-item" style="text-align: center;">
        <button class="layui-btn layui-btn-success" type="submit">
            <i class="layui-icon layui-icon-ok"></i> 保存
        </button> &nbsp; &nbsp; &nbsp;
        <button class="layui-btn" type="reset">
            <i class="layui-icon layui-icon-refresh"></i> 重置
        </button>

    </div>
</form>


